#!/bin/bash

#=======================================================================
# wavto16
# File ID: e755fe92-820c-11e2-814c-0016d364066c
# [Description]
# License: GNU General Public License version 2 or later.
#=======================================================================

for f in "$@"; do
    wavfile="$f"
    tmpfile="$f.tmp.wav"
    cp -p "$wavfile" "$wavfile.bck"
    mplayer -novideo -af format=s16le -ao "pcm:file=$tmpfile" "$wavfile"
    mv "$tmpfile" "$wavfile"
done
